<template>

    <div class="windowss_see">
      <titleDiv
        :title="title"
        :isShow="true"
        text1="创建人："
        text2="创建时间："
        :value1="listItem.founder"
        :value2="listItem.creatTime"
      ></titleDiv>
    <div class="main">
      <el-form ref="form"  label-width="150px">
          <el-form-item label="网点管理员：">
          <span class="rightText">{{ listItem.name }}</span>
          </el-form-item>
          <el-form-item label="管理账号：">
            <span class="rightText">{{ listItem.user }}</span>
          </el-form-item>
          <el-form-item label="网点名称：">
            <span class="rightText">{{listItem.lattcieName}}</span>
          </el-form-item>
          <el-form-item label="备注：">
            <span class="rightText">{{ listItem.remarks }}</span>
          </el-form-item>
          <el-form-item>
            <el-button class="btn" type="primary" @click="goLink({path:'/orgPeople/orgPeopleEdit?',query:{id:windowId}})">编辑</el-button>
            <el-button class="btn"  @click="deleteIndex(windowId)"  :plain="true">删除</el-button>
          </el-form-item>
        </el-form>
       </div>
    </div>
</template>
<script>
  import titleDiv from './view/titleDiv.vue'
  import {orgManagerDetail,orgManagerDelete} from "../api/getData"
import { setTimeout } from 'timers';
  export default {
    name: 'windowss_see',
    data: function () {
      return {
        title:"人员详情",
        form:'',
        listItem:"",
        windowId:'',
      }
    },
    components:{
      titleDiv
    },
    created: function () {}, // 创建时
    beforeMount: function () {}, // 挂载之前
    mounted: function () {
        this.windowId = this.$route.query.id;
        orgManagerDetail({ "personid":this.windowId}).then((data) =>{
            this.listItem = data.data.data
            console.log(this.listItem,'哈哈')
        })
    }, // 挂载之后
    beforeUpdate: function () {}, // 数据更新时调用,在渲染之前
    updated: function () {}, // 数据更新后,渲染后调用(禁止)
    beforeDestroy: function () {}, // 实例销毁前调用,解绑中间层的数据传输
    destroyed: function () {}, // 实例销毁后调用
    methods: {
       goLink (url) {
        this.$router.push(url)
      },
      deleteIndex(e){
          orgManagerDelete({"personid":e}).then((data) =>{
            console.log(data)
            if(data.data.code === 0){
                this.$message({
                  showClose: true,
                  message: data.data.msg,
                  type: 'success'
                });
                var _this = this;
            setTimeout(function() {
              _this.$router.push ("/orgPeople/orgPeopleIndex");
            },1000);
              }else{
                this.$message({
                  showClose: true,
                  message: data.data.msg,
                  type: 'fail'
                });
              }
          })
      }
    } // 函数
  }
</script>
<style lang='scss'>
    .windowss_see{
    box-sizing: border-box;
    .main{
      background: #fff;
      width: 100%;
      margin-top: 3%;
      padding: 5% 20%;
      .textInner{
        color: #808492;
        font-size: 12px;
      }
      .el-form-item__label{
        font-weight: bold;
      }
      .btn{
        width: 120px;
        height:32px;
        line-height: 1px;
        margin-left: 100px;
      }
      .btnsc{
        background-color: #fff;
        border:1px solid #ccc;
        color: #ccc;
      }
    }
  }
</style>
